Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FIX) Error for array of integers for postgres #10340

Closed
wants to merge 1 commit into from

Conversation

Slike9
Copy link

@Slike9 Slike9 commented Apr 25, 2013

Field description in schema: t.integer :field_name, :type => :array.
Error: "undefined method `gsub' for 1:Fixnum" in PostgreSQLColumn#quote_and_escape.

Field description in schema: `t.integer :field_name, :type => :array`. 
Error: "undefined method `gsub' for 1:Fixnum" in PostgreSQLColumn#quote_and_escape.
@rafaelfranca
Copy link
Member

We'll need a test to this

@senny
Copy link
Member

senny commented Jun 23, 2013

@Slike9 ping, what is the status of this PR? Can you add a test-case?

@Slike9
Copy link
Author

Slike9 commented Jun 24, 2013

test fails (PostgresqlArrayTest#test_multi_dimensional)

@Slike9 Slike9 closed this Jun 24, 2013
@Numerico
Copy link

Getting this error on v4.0.0.beta1 too

@arunagw
Copy link
Member

arunagw commented Jun 26, 2013

@Numerico on 4.0.0 too?

@Numerico
Copy link

Numerico commented Jul 1, 2013

that's right. (or you mean to test it against 4.0.0 instead of 4.0.0.beta1?)

i finally by-passed it having an array of strings instead of integers, but I suppose it should work for ints, shouldn't it?

@hubertlepicki
Copy link
Contributor

I can confirm this is a problem and the pull request fixes it, so I am unsure why this has been closed. Can someone @Slike9 or @rafaelfranca re-open the issue?

@arunagw arunagw reopened this Jul 2, 2013
@neerajsingh0101
Copy link

@hubertlepicki can you describe what problem you ran into. The PR description says it fixes the issue with t.integer :field_name, :type => :array . However that already works in master. Thanks.

@hubertlepicki
Copy link
Contributor

Tell you what, I'll make a separate pull request as this is, indeed similar, but slight different issue than described at least in the description here.

@saulius
Copy link
Contributor

saulius commented Jul 10, 2013

This issue stops me from upgrading one of the apps to Rails 4. Fix in #11245 seems to resolve the issue. Just wanted to give heads up.

@sevenseacat
Copy link
Contributor

Also run into this issue in Rails 4.0.0. On a side note, type: :array did not work for me, I had to use array: true to get AR to even recognize the field as an array.

Changing the field to be of type string instead of integer also resolved the problem.

@senny
Copy link
Member

senny commented Feb 13, 2014

Closing this PR. We have #11245 with a working solution. @Slike9 thanks for your work 💛

@senny senny closed this Feb 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants